package com.example.vaccine.controller.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class StaticResourceConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射 /avatar/** 到 D:/vaccine-avatars/
        registry.addResourceHandler("/avatar/**")
                .addResourceLocations("file:D:/vaccine-avatars/");
    }
}